package com.itheima.service.impl;

import com.itheima.dao.PersonDao;
import com.itheima.pojo.Person;
import com.itheima.service.PersonService;

import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class PersonServiceImpl implements PersonService {

    private PersonDao personDao;
    private int id;
    private String name;
    private String[] hobby;
    private List<String> listCourse;
    private Set<String> setCourse;
    private Map<String,String> mapAddr;
    private List<Person> listPerson;

    @Override
    public String toString() {
        return "PersonServiceImpl{\n\r" +
                "personDao=" + personDao +"\n\r" +
                ", id=" + id +"\n\r" +
                ", name='" + name + '\'' +"\n\r" +
                ", hobby=" + Arrays.toString(hobby) +"\n\r" +
                ", listCourse=" + listCourse +"\n\r" +
                ", setCourse=" + setCourse +"\n\r" +
                ", mapAddr=" + mapAddr +"\n\r" +
                ", listPerson=" + listPerson +"\n\r" +
                '}';
    }

    public void setPersonDao(PersonDao personDao) {
        this.personDao = personDao;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setHobby(String[] hobby) {
        this.hobby = hobby;
    }

    public void setListCourse(List<String> listCourse) {
        this.listCourse = listCourse;
    }

    public void setSetCourse(Set<String> setCourse) {
        this.setCourse = setCourse;
    }

    public void setMapAddr(Map<String, String> mapAddr) {
        this.mapAddr = mapAddr;
    }

    public void setListPerson(List<Person> listPerson) {
        this.listPerson = listPerson;
    }

    @Override
    public void save() {
        System.out.println("PersonServiceImpl save ---->");
        personDao.save();
        System.out.println(this.toString());
    }
}
